package fourth;

import java.util.Arrays;
import java.util.Scanner;

public class seven_5 {
    public static void main(String[] args) {
        int[] arr = new int [10];

        int ans=0;
        Scanner input = new Scanner(System.in);
        System.out.println("Enter 10 numbers: ");

        for(int i=0;i<10;i++) {
            int x = input.nextInt();
            boolean flag=true;
            for (int j = i; j >= 0; j--) {
                if(x==arr[j]){
                    flag=false;
                    break;
                }

            }
            if(flag){
            arr[ans] = x;
            ans++;}
        }


        System.out.println("The  number of distinct numbers is : "+ ans);

        for(int i=0;i<ans;i++){
            System.out.print(arr[i]+" ");
        }
    }
}
